<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableOperationLogs extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('operation_logs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('path')->default('');
            $table->string('params')->default('');
            $table->string('action')->default('');
            $table->string('operation_ip')->default('');
            $table->unsignedInteger('operation_id')->default(0);
            $table->timestamps();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `operation_logs` COMMENT='操作日志'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('operation_logs');
    }
}
